package com.zyb.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zyb.dao.GoodsDao;
import com.zyb.domain.Brand;
import com.zyb.domain.Goods;
import com.zyb.domain.Type;
import com.zyb.service.GoodsService;

@Service
public class GoodsServiceImpl implements GoodsService {
	@Resource
	private GoodsDao goodsDao;
	@Override
	public PageInfo<Goods> list(Integer pageNum, Integer pageSize) {
	PageHelper.startPage(pageNum, pageSize);
	List<Goods> list = goodsDao.list();
	PageInfo<Goods> page = new PageInfo<Goods>(list);
		return page;
	}
	@Override
	public int add(Goods goods) {
		// TODO Auto-generated method stub
		return goodsDao.add(goods);
	}
	@Override
	public List<Brand> brands() {
		// TODO Auto-generated method stub
		return goodsDao.brands();
	}
	@Override
	public List<Type> types() {
		// TODO Auto-generated method stub
		return goodsDao.types();
	}
	@Override
	public Goods toUpda(Integer id) {
		// TODO Auto-generated method stub
		return goodsDao.toUpda(id);
	}
	@Override
	public int update(Goods goods) {
		// TODO Auto-generated method stub
		return goodsDao.update(goods);
	}
	@Override
	public int dele(Integer id) {
		// TODO Auto-generated method stub
		return goodsDao.dele(id);
	}
	
}
